<script language="javascript">
<?php
			$format =  TI18n::Locale()->DateFormat();
			$format = preg_replace('/d/','dd',$format);
			$format = preg_replace('/j/','d',$format);
			$format = preg_replace('/j/','d',$format);
			$format = preg_replace('/l/','DD',$format);
			$format = preg_replace('/F/','MM',$format);
			$format = preg_replace('/m/','mm',$format);
			$format = preg_replace('/n/','m',$format);
			$format = preg_replace('/n/','m',$format);
			$format = preg_replace('/Y/','yy',$format);
			$format = preg_replace('/y/','y',$format);

?>
	$(document).ready(function(){
		$("input.date-editor").datepicker({
			changeMonth:true,
			changeYear:true,
			constrainInput:true,
			dateFormat:"<?php echo $format; ?>",
			dayNames:<?php echo json_encode(TI18n::Locale()->WeekDayNames()); ?>,
			dayNamesMin:<?php echo json_encode(TI18n::Locale()->WeekDayNames(ILocale::NT_MIN)); ?>,
			dayNamesShort:<?php echo json_encode(TI18n::Locale()->WeekDayNames(ILocale::NT_SHORT)); ?>,
			firstDay:<?php echo TI18n::Locale()->FirstWeekDay(); ?>,
			monthNames:<?php echo json_encode(TI18n::Locale()->MonthNames(ILocale::NT_SHORT)); ?>,
			monthNamesShort:<?php echo json_encode(TI18n::Locale()->MonthNames(ILocale::NT_SHORT)); ?>,
			yearRange:"1950:2050"			
		});		
	});
</script>